#ifndef MAIN_H
#define MAIN_H



/*************************************************
 * Description 	        : Main Program for command interpreter
 * Last update 	        : See File Date
 * Crystal 				: Defined in Crystal
 * Email 				:
 *
 *************************************************/


/*Test1*/
#include <stdint.h>
#include <stdlib.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/eeprom.h>
#include <avr/pgmspace.h>

#define CRYSTAL         3686000 //MHz  	// Clock frequency
//#define CRYSTAL       4000000   	// Clock frequency


#define RECEIVERADDR  10 //This is the device adress

#define FRAME_SIZE  8 //This is the number off bytes that are needed for this frame


#define LED_PORT PORTB				// this is are display port
#define LED_PORT_DIR DDRB			// Direction control for LED Port


#define SWITCH_VALUE PINA 			// Connected with the switches
#define SWITCH_PORT_DIR DDRA

typedef enum 
{
	Decode_WAITSTART,		// Wait for the start header to recieve complete
	Decode_STRTDEC,		// The following bytes are for our receiver
	Decode_FLUSH,				// Flush The receiver (message invalid)
	Decode_DONE			// The message is in the bufer !!

} Decode_State; // State machine for decoding sequential characters

extern  Decode_State Decode_StateReception;



//#include <FrameReceiverDecoder.c>  // include the FRameReceiver reader



//**** Prototypes SlaveMain.h ***/
void SlvMn_init(void);
int main (void);
void SlvMn_DoRepeatedTask (void); //This routine is called every mSec
void Slvm_BugTest(void);

//**


/*
enum Decode_State
{
	Decode_WAITSTART,		// Wait for the start header to recieve complete
	Decode_STRTDEC,		// The following bytes are for our receiver
	Decode_FLUSH,				// Flush The receiver (message invalid)
	Decode_DONE			// The message is in the bufer !!

} __attribute__((packed)) Decode_StateReception = Decode_WAITSTART; // State machine for decoding sequential characters
*/







#endif 
